package com.atguigu.client;

import com.atguigu.entity.*;
import com.atguigu.fallback.ProductFallback;
import com.atguigu.result.RetVal;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@FeignClient(value = "shop-product",fallback = ProductFallback.class)
public interface ProductFeignClient {
    //1.根据skuid获取sku的基本信息(skuInfo)
    @GetMapping("/sku/getSkuInfo/{skuId}")
    public SkuInfo getSkuInfo(@PathVariable Long skuId);
    //2.根据skuid获取spu的销售属性
    @GetMapping("/sku/getSpuSaleProperty/{productId}/{skuId}")
    public List<ProductSalePropertyKey> getSpuSaleProperty(@PathVariable Long productId, @PathVariable Long skuId);
    //3.根据skuid获取sku的实时价格信息
    @GetMapping("/sku/getSkuPrice/{skuId}")
    public BigDecimal getSkuPrice(@PathVariable Long skuId);
    //4.根据category3Id获取sku的分类信息
    @GetMapping("/sku/getCategoryView/{category3Id}")
    public BaseCategoryView getCategoryView(@PathVariable Long category3Id);
    //5.根据spuId获取该spu所对应的所有sku的销售属性值与sku的对应关系
    @GetMapping("/sku/getSkuSalePropertyValueIdMapping/{productId}")
    public Map getSkuSalePropertyValueIdMapping(@PathVariable Long productId);
    //6.查询所有分类信息
    @GetMapping("/product/getIndexCategoryInfo")
    public RetVal getIndexCategoryInfo();
    //7.通过brandId查询品牌信息
    @GetMapping("/sku/getBrandById/{brandId}")
    public BaseBrand getBrandById(@PathVariable Long brandId);
    //8.根据skuId查询平台属性信息
    @GetMapping("/product/getPlatformPropertyBySkuId/{skuId}")
    public List<PlatformPropertyKey> getPlatformPropertyBySkuId(@PathVariable Long skuId);
}
